package com.xy.objectadapter;


/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/11 14:38
 * @description
 */
public class VoltageAdapter implements Voltage5V {
    private Voltage220V voltage220V = null;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int src = 0;
        if (voltage220V != null) {
            src = voltage220V.output220V();
        }
        int dst = src / 44;
        System.out.printf("适配器将%d伏====>%d伏\n",src,dst);
        return dst;
    }
}
